import tensorflow as tf


def log_loss(predictions, labels, epsilon=1e-7):
    # loss = - math_ops.multiply(labels, math_ops.log(predictions + epsilon)) - math_ops.multiply((1 - labels),
    # math_ops.log(1 - predictions + epsilon))
    loss = tf.losses.log_loss(
        labels, predictions, weights=1.0, epsilon=epsilon, scope=None,
    )
    return loss
